home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus Special 23 / AMIGAplus Sonderheft 23 (2000)(Falke)(DE)[!].iso / Tools / Text-Viewer / MSWordView / mswordview_src / gpprl.c < prev    next >
Encoding:
C/C++ Source or Header  |  1999-11-06  |  2.2 KB  |  99 lines

  1.  
  2. #include <stdio.h>
  3. #include "config.h"
  4. #include "mswordview.h"
  5.  
  6. extern FILE *erroroutput;
  7. extern FILE *outputfile;
  8. extern long int cp;
  9. extern int insuper;
  10. extern int footnotehack;
  11.  
  12.  
  13. void decode_gpprls(pap *apap,chp *achp,sep *asep,U16 *gpprl,int index,Sprm *sprmlists,style *sheet)
  14.     {
  15.     /**/
  16.     int j=0;
  17.     U16 i=0;
  18.     Sprm *thesprmlist=sprmlists;
  19.     U16 sprm;
  20.     U8 operand;
  21.     U8 *pointer;
  22.     U8 littlelist[2];
  23.     int val;
  24.  
  25.     error(erroroutput,"index were looking for is %d\n",index);
  26.     if (index <0)
  27.         return;
  28.  
  29.     /*the index were given is the sprm, if its a varient 1 
  30.     ignore it for now, if its varient 2 go through the list of sprms countinf
  31.     varients 2, until we get to this one*/
  32.     if (0 == (gpprl[index] & 0x01))
  33.         {
  34.         error(erroroutput,"varient 1s, (%x)\n",gpprl[index]);
  35.         error(erroroutput,"sprm varient 1, isprm is %x, val is %d\n",(gpprl[index]&0x00fe)>>1,(gpprl[index]&0xff00)>>8);
  36.         sprm = (gpprl[index]&0x00fe)>>1;
  37.         operand = (gpprl[index]&0xff00)>>8;
  38.         error(erroroutput,"GPRL is (%x) operand is %d",sprm,operand);
  39.         switch (sprm)
  40.             {
  41.             case 5:
  42.                 sprm = 0x2403;
  43.                 littlelist[0] = operand;
  44.                 break;
  45.             default:
  46.                 error(erroroutput,"unsupported gpprl %d\n",sprm);
  47.                 return;
  48.                 break;
  49.             }
  50.         pointer = littlelist;
  51.         decode_sprm(NULL,sprm,apap,achp,asep,&i,&pointer,sheet,apap->istd);
  52.         return;
  53.         }
  54.     else
  55.         {
  56.         error(erroroutput,"varient 2s, (%x) (%x) (%x)\n",(gpprl[index]&0xFFFE)>>1,gpprl[index]>>1,gpprl[index]);
  57.         /*
  58.         for (i=0;i<index;i++)
  59.             {
  60.             if (gpprl[i] & 0x01)
  61.                 j++;
  62.             }
  63.         */
  64.         error(erroroutput,"read index val is %d\n",j);
  65.         }
  66.     i=0;    
  67.     val = (gpprl[index]&0xFFFE)>>1;
  68.     
  69.     while(i<val)
  70.         {
  71.         thesprmlist=thesprmlist->next;
  72.         if (thesprmlist == NULL)
  73.             {
  74.             error(erroroutput,"gpprl index is wrong at %d!\n",i);
  75.             return;
  76.             }
  77.         i++;
  78.         }
  79.  
  80.  
  81. /*hum 261*/
  82.     i=0;
  83.     error(erroroutput,"sprm list len is %d\n",thesprmlist->len);
  84.     while (i<thesprmlist->len)
  85.         {
  86.         sprm = sread_16ubit(thesprmlist->list+i);
  87.         i+=2;
  88.         error(erroroutput,"clist is %x, at len point %d\n",sprm,i);
  89.  
  90.         pointer = thesprmlist->list+i;
  91.         if (apap == NULL)
  92.             fprintf(erroroutput,"aha !!\n");
  93.  
  94.         decode_sprm(NULL,sprm,apap,achp,asep,&i,&pointer,sheet,apap->istd);
  95.         error(erroroutput,"after line\n");
  96.         /*change above to include sep*/
  97.         }
  98.     }
  99.